import request from "@/utils/request";

/**
 * 查询字典
 *
 * @returns
 */
export const queryDictData = async (params: any) => {
	return await request({
		url: `/system/dict/data/type/${params.dictType}`,
		method: "get",

	});
};

/**
 * 查询房屋
 *
 * @returns
 */
export const queryHouseManageList = async (params: any) => {
	return await request({
		url: `/houseManage/query`,
		method: "get",
		params
	});
};

/* 新增房屋 */
export const fetchHouseManageAdd = async (params: any) => {
	return await request({
		url: `/houseManage/add`,
		method: "post",
		data: params
	});
};

/* 详情 */
export const queryHouseManageDetails = async (params: any) => {
	return await request({
		url: `/houseManage/details/${params.houseManageId}`,
		method: "get",
		params
	});
};


/* 编辑 */
export const fetchHouseManageEdit = async (params: any) => {
	return await request({
		url: `/houseManage/edit`,
		method: "put",
		data: params
	});
};

/* 删除 */
export const fetchHouseManageDelete = async (params: any) => {
	return await request({
		url: `/houseManage/del/${params.houseManageId}`,
		method: "delete",
		data: params
	});
};

/* 上传附件 */
export const fetchHouseManageUpload = async (params: any, busId: any) => {
	return await request({
		url: `/houseManage/upload?busId=${busId}`,
		method: "post",
		data: params
	});
};
